package MyByteStream2;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class ByteStreamDemo6 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("csb.txt");
        FileOutputStream fos = new FileOutputStream("D:\\File\\aa.txt");
        try (fis;fos){
            byte[]bytes = new byte[2];
            int len;
            while ((len = fis.read(bytes)) != -1){
                fos.write(bytes,0,len);
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
